<?php
	@$id_prod = $_GET['id'];
	$id_cat = $_GET['cat'];
	//echo $id_cat;
	include_once('libs/htdu_core.php');
	$exe_mysql = new execute_mysql_query();
	$g_func = new global_function();
	$result = $exe_mysql->execute("select * from node where id = $id_prod", 0);
	$row = mysql_fetch_array($result);
	
	function cut($str, $len) {
    $str = trim($str);
    if (strlen($str) <= $len) return $str;
    $str = substr($str, 0, $len);
    if ($str != "") {
        if (!substr_count($str, " ")) return $str." ...";
        while (strlen($str) && ($str[strlen($str) - 1] != " ")) $str = substr($str, 0, -1);
        $str = substr($str, 0, -1)." ...";
    }
    return $str;
	}	
?>
<link rel="stylesheet" href="css/text_css_hqk.css" type="text/css" />

<div class="detail_prod">
	<div class="detail_title"><?php echo $row['title_'.$LOCAL]; ?></div>
    <div><?php echo '<p>'.$row['content_'.$LOCAL].'</p>'; ?></div>
</div>
<div class="sp_cungloai">
	<div class="line">
		<p class="group-line"><span class="group-title"><?php echo $MULTI_LANG->get_word_by_key('other_product'); ?></span></p>
    </div>
   
    <?php
	$idtype = $row['id_type'];
    $result2 = $exe_mysql->execute("select * from node where id_type = $idtype and id_ref = $id_cat and id <> $id_prod order by id desc", 0);
	while($row2 = mysql_fetch_array($result2))
	{
		echo '<div class="list_cung_loai">';
		echo '<div class="hinh"><a href="chi-tiet-san-pham-'.$row2['id_ref'].'-'.$g_func->remove_sign($row2['title_'.$LOCAL]).'-'.$row2['id'].'.html" ><img src="'.$row2['img'].'" width="100px" height="80px" border="0px" alt="'.$row2['title_'.$LOCAL].'" title="'.$row2['title_'.$LOCAL].'" /></a></div>';
		echo '<div class="xem_tiep"><a href="chi-tiet-san-pham-'.$row2['id_ref'].'-'.$g_func->remove_sign($row2['title_'.$LOCAL]).'-'.$row2['id'].'.html" >'.cut($row2['title_'.$LOCAL],15).'</a></div>';
		echo '</div>';
	}
    ?>
</div>
